<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:tiles="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8"/>
    <title tiles:fragment="title">新建申请单</title>

    <link href="../../../static/css/all.css" rel="stylesheet" type="text/css"/>
    <script src="../../../static/js/main.js"></script>
</head>

<body>

<div class="content" th:fragment="content" tiles:fragment="content">
    <div class="content-nav">
        <div class="titleNav">
            <div class="title_nav title_nav_Now">
                <a>新建申请单</a>
            </div>
        </div>
    </div>

    <!--<div class="content-function">-->
    <!--<div class="myDivBt">-->
    <!--<a href="additem.html" th:href="@{/apply/add/additem}" th:method="get">添加物品</a>-->
    <!--</div>-->
    <!--</div>-->
    <div class="content-function">
        <div class="myDivBt">
            <a href="#addItem" onclick="jumpTo('apply/add/additemajax')">添加物品</a>
        </div>
    </div>

    <div class="content-result myTable">
        <caption>
            申请单编号：<p th:text="${session.apply_form.applicationId}"></p>
        </caption>
        <table id="apply_for_submit">
            <thead>
            <tr>
                <th>物品条形码</th>
                <th>物品名称</th>
                <th>数量</th>
                <th>备注</th>
                <th>删除</th>
            </tr>
            </thead>
            <!--/*@thymesVar id="apply_form" type="com.repository.web.apply.add.AddapplyController.ApplyForm"*/-->
            <tbody>
            <tr th:if="${session.apply_form == null || session.apply_form.items.isEmpty()}">
                <td colspan="5">申请单中没有物品，请添加</td>
            </tr>
            <tr th:each="item : ${session.apply_form.getItems()}"
                th:class="${item.getItemCode()}">
                <td th:text="${item.getItemCode()}"></td>
                <td th:text="${item.getItemName()}"></td>
                <td th:text="${item.getItemCount()}"></td>
                <td th:text="${item.getOthers()}"></td>
                <td class="myTable-operation-warning icon-trash"
                    th:onclick="'applyDelet(\''+${item.getItemCode()}+'\')'">
                </td>
            </tr>
            </tbody>
            <tfoot>
            <tr>
                <td colspan="2"><button class="myInput-danger" onclick="apply_clear()">清空</button></td>
                <td ></td>
                <td colspan="2"><button onclick="applyToSubmit()">提交</button></td>
            </tr>
            </tfoot>
        </table>
        <!--<div class="content-result-operation">-->
            <!--<div class="myDivBt">-->
                <!--<a onclick="applyToSubmit()">提交</a>-->
            <!--</div>-->
            <!--<div class="myDivBt">-->
                <!--<a type="button" onclick="apply_clear()">清空</a>-->
            <!--</div>-->
        <!--</div>-->
    </div>
</div>
</body>
</html>